/*
Author: Max E. K
*/
using System;
using System.Collections;
using System.Collections.Generic;

namespace OpenGado.DATA.Entities
{
	/// <summary>
	/// ProjectHasProduct object for NHibernate mapped table 'project_has_product'.
	/// </summary>
	[Serializable]
	public class ProjectHasProduct
	{
		#region Member Variables
		protected int _uniqid;
		protected Project _project;
		protected Product _product;
		protected decimal? _productquantity;
		#endregion
		#region Constructors
			
		public ProjectHasProduct() {}
					
		public ProjectHasProduct(Project project, Product product, decimal? productquantity) 
		{
			this._project= project;
			this._product= product;
			this._productquantity= productquantity;
		}

		public ProjectHasProduct(Project project, Product product)
		{
			this._project= project;
			this._product= product;
		}
		
		#endregion
		#region Public Properties
		public  virtual int Uniqid
		{
			get { return _uniqid; }
			set {_uniqid= value; }
		}
		public  virtual Project Project
		{
			get { return _project; }
			set {_project= value; }
		}
		public  virtual Product Product
		{
			get { return _product; }
			set {_product= value; }
		}
		public  virtual decimal? ProductQuantity
		{
			get { return _productquantity; }
			set {_productquantity= value; }
		}
		#endregion
		
		#region Equals And HashCode Overrides
		/// <summary>
		/// local implementation of Equals based on unique value members
		/// </summary>
		public override bool Equals( object obj )
		{
			if( this == obj ) return true;
			if( ( obj == null ) || ( obj.GetType() != this.GetType() ) ) return false;
			ProjectHasProduct castObj = (ProjectHasProduct)obj;
			return ( castObj != null ) &&
			this._uniqid == castObj.Uniqid;
		}
		/// <summary>
		/// local implementation of GetHashCode based on unique value members
		/// </summary>
		public override int GetHashCode()
		{
			int hash = 57;
			hash = 27 * hash * _uniqid.GetHashCode();
			return hash;
		}
		#endregion
		
	}
}
